package com.example.zuoye.service.impl;

import com.example.zuoye.dao.SearchGoodDAO;
import com.example.zuoye.entity.Good;
import com.example.zuoye.service.SearchGoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SearchGoodServiceImpl implements SearchGoodService {

    @Autowired
    SearchGoodDAO searchGoodDAO;

    @Override
    public List<Good> getListSearchGood(String search, Integer page, Integer size) {
        Integer offsize = (page-1)*size;
        search = '%'+search+'%';
        return searchGoodDAO.getListSearchGood(search,offsize,size);
    }
}
